#include "dmpch.h"
#include "Dream/Renderer/Texture.h"

#include "Dream/Renderer/Renderer.h"
#include "Platform/OpenGL/OpenGLTexture.h"

namespace Dream
{
	Ref<Texture2D> Texture2D::Create(uint32_t width, uint32_t height)
	{
		switch (Renderer::GetAPI())
		{
		case RendererAPI::API::None:
			DM_CORE_ASSERT(false, "RendererAPI::None is currently not supported!");
			return nullptr;
		case RendererAPI::API::OpenGL:
			return MakeRef<OpenGLTexture2D>(width, height);
		case RendererAPI::API::Vulkan:
			DM_CORE_ASSERT(false, "RendererAPI::Vulkan is currently not supported!");
			return nullptr;
		default:
			DM_CORE_ASSERT(false, "Unknown RendererAPI!");
			return nullptr;
		}
		DM_CORE_ASSERT(false, "Unknown RendererAPI!");
		return nullptr;
	}
	Ref<Texture2D> Texture2D::Create(const std::string& path)
	{
		switch (Renderer::GetAPI())
		{
		case RendererAPI::API::None:    DM_CORE_ASSERT(false, "RendererAPI::None is currently not supported!"); return nullptr;
		case RendererAPI::API::OpenGL:  return MakeRef<OpenGLTexture2D>(path);
		case RendererAPI::API::Vulkan: DM_CORE_ASSERT(false, "RendererAPI::Vulkan is currently not supported!"); return nullptr;
		default:
			DM_CORE_ASSERT(false, "Unknown RendererAPI!");
		}
		DM_CORE_ASSERT(false, "Unknown RendererAPI!");
		return nullptr;
	}

}